/**
 *
 */
package com.hexacta.hrs.services.staffing.impl.predicates;

import org.apache.commons.collections.Predicate;

import com.hexacta.hrs.domain.staffing.assignment.EmployeeAssignment;

/**
 * @author ldeveikis
 *
 */
public class ProjectPredicate implements Predicate {

	private Long id;

	private ProjectPredicate() {
	}

	public ProjectPredicate(String id) {
		this.id = Long.decode(id);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.apache.commons.collections.Predicate#evaluate(java.lang.Object)
	 */
	@Override
	public boolean evaluate(Object object) {
		return ((object instanceof EmployeeAssignment) && ((EmployeeAssignment) object)
				.getProject().getId().equals(id));
	}

}
